#coding=utf-8

import django_filters

from django.conf import settings
from django.db import models
from models import *


class merchantinfoFilter(django_filters.rest_framework.FilterSet):
    merchantid = django_filters.NumberFilter()
    #merchantname = django_filters.CharFilter(required=True,help_text=u"商家名称")
    class Meta:
        model = merchant_info
	fields = ['merchantid']
class merchantselfFilter(django_filters.rest_framework.FilterSet):
    #merchantid = django_filters.NumberFilter()
    password = django_filters.CharFilter(required=True,help_text=u"密码")
    mobile = django_filters.CharFilter(required=True,help_text=u"手机号")
    class Meta:
        model = merchant_info
	fields = ['mobile','password']

class userconsumeFilter(django_filters.rest_framework.FilterSet):
    #merchantid = django_filters.NumberFilter()
    pay_time = django_filters.DateFromToRangeFilter()
    uid = django_filters.NumberFilter()
    status = django_filters.NumberFilter()
    order_type = django_filters.NumberFilter()
    class Meta:
        model = user_consume
	fields = ['pay_time','uid','status','order_type']
class userrechargeFilter(django_filters.rest_framework.FilterSet):
    #merchantid = django_filters.NumberFilter()
    recharge_time = django_filters.DateFromToRangeFilter()
    uid = django_filters.NumberFilter()
    recharge_status = django_filters.NumberFilter()
    rechatge_type   = django_filters.NumberFilter()
    class Meta:
        model = user_recharge
	fields = ['recharge_time','uid','recharge_status','rechatge_type']
class productOrderFilter(django_filters.rest_framework.FilterSet):
    productid = django_filters.NumberFilter()
    status = django_filters.NumberFilter()
    class Meta:
        model = product_order
	fields = ['productid','status','status']

class StoreReportFilter(django_filters.rest_framework.FilterSet):
    #merchantid = django_filters.NumberFilter()
    datetime = django_filters.DateFromToRangeFilter()
    #merchantid = django_filters.NumberFilter()

    class Meta:
        model = store_report
	fields = ['datetime']
class wscTemplateFilter(django_filters.rest_framework.FilterSet):

    class Meta:
        model = wsc_template
	fields = ['name','id']
class VodErrorLogFilter(django_filters.rest_framework.FilterSet):
    error_code = django_filters.CharFilter(name='error_code',help_text = '错误码')
    class Meta:
        model = Vod_errorlog
	fields = ['error_code']
